package com.gupaoedu.pattern.observer.gper;

import java.util.Observable;

/**
 * 2019/9/28
 * created by chenpp
 * 论坛 被观察者(发送消息的一方)
 */
public class GPer extends Observable {
    /**
     * 论坛名
     * */
    private String name ;

    public void setName(String name){
        this.name = name;
    }

    public void publishQuestion(Question question){
        System.out.println(question.getName()+"在"+name+"上提出了一个问题");
        setChanged();
        //通知观察者
        notifyObservers(question);
    }

}
